<script type="text/javascript" src="{$base_uri}js/AJAX_Insurance.js"></script>
<script type="text/javascript">
{literal}
    $(document).ready(function(){
        $('#editInsuranceFrm #registeredHospital').autocomplete('../Insurance/getHospitalAjax?set_ajax_view',
                {
		            multiple: false,
		            matchContains: true,
		            autoFill: true,
		            cacheLength: 1,
		            formatItem: function(data, i, total) {      
		                return data[0];
		            }
                }
        );
        
        $('#editInsuranceFrm #insuranceCode_0').autotab({ target: $('#editInsuranceFrm #insuranceCode_1'), format: 'text', uppercase: true});
        $('#editInsuranceFrm #insuranceCode_1').autotab({privious: $('#editInsuranceFrm #insuranceCode_0'), target: $('#editInsuranceFrm #insuranceCode_2'), format: 'numeric', uppercase: true});
        $('#editInsuranceFrm #insuranceCode_2').autotab({privious: $('#editInsuranceFrm #insuranceCode_1'), target: $('#editInsuranceFrm #insuranceCode_3'), format: 'numeric', uppercase: true});
        $('#editInsuranceFrm #insuranceCode_3').autotab({privious: $('#editInsuranceFrm #insuranceCode_2'), target: $('#editInsuranceFrm #insuranceCode_4'), format: 'numeric', uppercase: true});
        $('#editInsuranceFrm #insuranceCode_4').autotab({privious: $('#editInsuranceFrm #insuranceCode_3'), target: $('#editInsuranceFrm #insuranceCode_5'), format: 'numeric', uppercase: true});
        $('#editInsuranceFrm #insuranceCode_5').autotab({privious: $('#editInsuranceFrm #insuranceCode_4'), target: $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_0}'{literal}), format: 'numeric', uppercase: true});

        $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_0}'{literal}).autotab({target: $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_1}'{literal}), format: 'numeric'});
        $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_1}'{literal}).autotab({privious: $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_2}'{literal}), target: $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_2}'{literal}), format: 'numeric'});
        $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_2}'{literal}).autotab({privious: $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_1}'{literal}), target: $('#editInsuranceFrm #expired_' + {/literal}'{$datePart_0}'{literal}), format: 'numeric'});

        $('#editInsuranceFrm #expired_' + {/literal}'{$datePart_0}'{literal}).autotab({privious: $('#editInsuranceFrm #issued_' + {/literal}'{$datePart_2}'{literal}), target: $('#editInsuranceFrm #expired_' + {/literal}'{$datePart_1}'{literal}), format: 'numeric'});
        $('#editInsuranceFrm #expired_' + {/literal}'{$datePart_1}'{literal}).autotab({privious: $('#editInsuranceFrm #expired_' + {/literal}'{$datePart_2}'{literal}), target: $('#editInsuranceFrm #expired_' + {/literal}'{$datePart_2}'{literal}), format: 'numeric'});
        $('#editInsuranceFrm #expired_' + {/literal}'{$datePart_2}'{literal}).autotab({privious: $('#editInsuranceFrm #expired_' + {/literal}'{$datePart_1}'{literal}), target: $('#editInsuranceFrm #registeredHospital'), format: 'numeric'});
    });
{/literal}
</script>
<div>
    <div style="float: right; display: none;" id="editInsuranceLoaderDiv">
        <img src="images/ajax-loader.gif"/> 
    </div>
    <div><span style="font-style: italic;" id="editInsuranceMsg" class="formAlertMsg"></span></div>
    <form id="editInsuranceFrm">
        <input type="hidden" name="insuranceId" id="insuranceId" value="{$insuranceId}">
        {include file="insurance/element_insurance_common.html"}
	</form>
</div>